package com.hua.convert;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.io.FileInputStream;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * ClassName:TimeConvert
 * Package:com.hua.convert
 * Description:
 *
 * @data: 2022/10/19 12:59
 * @author:ChenJH
 */
@Component
public class TimeConvert implements Converter<String,LocalDate>  {
    @Override
    public LocalDate convert(String s) {
        try {
            return LocalDate.parse(s, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:SS"));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
